import { lazy } from "react";
// 引入路由表类型
import { RouteList } from "@/type";
import icon1 from '../../public/icon1.png'
import icon2 from '../../public/icon2.png'
import icon3 from '../../public/icon3.png'
import icon4 from '../../public/icon4.png'
import icon5 from '../../public/icon5.png'

// 二级路由
export const homeRoutes: RouteList = [
    {
        path: '/home/selected',
        title: '精选推荐',
        element: lazy(() => import('@/pages/Home/Selected')),
        icon: icon1,
    },
    {
        path: '/home/workbench',
        title: '工作台',
        element: lazy(() => import('@/pages/Home/Workbench')),
        icon: icon2,
    },
    {
        path: '/home/design',
        title: '创建设计',
        element: lazy(() => import('@/pages/Home/Design')),
        icon: icon4,
    },
    {
        path: '/home/setup',
        title: '偏好设置',
        element: lazy(() => import('@/pages/Home/Setup')),
        icon: icon5,
    },
    {
        path: '/home/collection',
        title: '我的收藏',
        element: lazy(() => import('@/pages/Home/Collection')),
        icon: icon3,
    }
]
// 一级路由
const routes: RouteList = [
    {
        path: '/',
        to: '/home/selected'
    },
    {
        path: '/home',
        title: 'home',
        element: lazy(() => import('@/pages/Home')),
        children: homeRoutes
    },
    {
        path: '/login',
        title: '登录',
        element: lazy(() => import('@/pages/Home')),
    },
    {
        path: '*',
        title: 'error',
        element: lazy(() => import("@/pages/Error"))
    },
    {
        path: '/dragDrop',
        title: '拖拽也',
        element: lazy(() => import('@/pages/DragDrop')),
    },
]
export default routes